"""
该文件用于 拼接页面
"""
import uiautomation as auto
from page.base_page import BasePage
from utils.utils_log import loggerCase

class AlignPage(BasePage):
    """拼接页面"""

    # 进入拼接按钮
    __align_button = auto.GroupControl(SubName="toolBarImg/Align")

    # 选择自动特征拼接
    __auto_feature_align = auto.GroupControl(SubName="alignPanel/feature")

    # 选择手动特征拼接
    __manual_feature_align = auto.GroupControl(SubName="alignPanel/manual")

    # 自动标志点特征拼接
    __auto_markers_align = auto.GroupControl(SubName="alignPanel/markers")

    # 手动标志点特征拼接
    __manual_markers_align = auto.GroupControl(SubName="alignPanel/manualMarker")

    # 固定窗口工程一
    __project1_at_fix = auto.TextControl(Name="access_Project1", foundIndex=1)

    # 固定窗口工程二
    __project2_at_fix = auto.TextControl(Name="access_Project2", foundIndex=1)

    # 固定窗口工程三
    __project3_at_fix = auto.TextControl(Name="access_Project3", foundIndex=1)

    # 浮动窗口工程一
    __project1_at_float = auto.TextControl(Name="access_Project1", foundIndex=2)

    # 浮动窗口工程二
    __project2_at_float = auto.TextControl(Name="access_Project2", foundIndex=2)

    # 浮动窗口工程三
    __project3_at_float = auto.TextControl(Name="access_Project3", foundIndex=2)

    # 固定窗口组一
    __group1_at_fix = auto.TextControl(Name="access_Group1", foundIndex=1)


    def click_enter_align(self, max_wait_time=3):
        """进入拼接"""
        loggerCase.info("点击进入拼接按钮")
        self.click(self.__align_button, max_wait_time=max_wait_time)

    def click_auto_feature_align(self, max_wait_time=3):
        """自动特征拼接"""
        loggerCase.info("点击自动特征拼接按钮")
        self.click(self.__auto_feature_align, max_wait_time=max_wait_time)

    def click_manual_feature_align(self, max_wait_time=3):
        """手动特征拼接"""
        loggerCase.info("点击手动特征拼接按钮")
        self.click(self.__manual_feature_align, max_wait_time=max_wait_time)

    def click_auto_markers_align(self, max_wait_time=3):
        """自动标志点拼接"""
        loggerCase.info("点击自动标志点拼接按钮")
        self.click(self.__auto_markers_align, max_wait_time=max_wait_time)

    def click_manual_markers_align(self, max_wait_time=3):
        """手动标志点拼接"""
        loggerCase.info("点击手动标志点拼接按钮")
        self.click(self.__manual_markers_align, max_wait_time=max_wait_time)

    def click_choose_project1_at_fix(self, max_wait_time=3):
        """选择固定工程一"""
        loggerCase.info("点击固定窗口选择工程一")
        self.click(self.__project1_at_fix, max_wait_time=max_wait_time)

    def click_choose_project2_at_fix(self, max_wait_time=3):
        """选择固定工程二"""
        loggerCase.info("点击固定窗口选择工程二")
        self.click(self.__project2_at_fix, max_wait_time=max_wait_time)

    def click_choose_project3_at_fix(self, max_wait_time=3):
        """选择固定工程三"""
        loggerCase.info("点击固定窗口选择工程三")
        self.click(self.__project3_at_fix, max_wait_time=max_wait_time)

    def click_choose_group1(self, max_wait_time=3):
        """选择组一"""
        loggerCase.info("点击固定窗口选择组一")
        self.click(self.__group1_at_fix, max_wait_time=max_wait_time)

    def click_choose_project1_at_float(self, max_wait_time=3):
        """选择浮动工程一"""
        loggerCase.info("点击浮动窗口选择工程二")
        self.click(self.__project1_at_float, max_wait_time=max_wait_time)

    def click_choose_project2_at_float(self, max_wait_time=3):
        """选择浮动工程二"""
        loggerCase.info("点击浮动窗口选择工程二")
        self.click(self.__project2_at_float, max_wait_time=max_wait_time)

    def click_choose_project3_at_float(self, max_wait_time=3):
        """选择浮动工程三"""
        loggerCase.info("点击浮动窗口选择工程三")
        self.click(self.__project3_at_float, max_wait_time=max_wait_time)




